next up previous
Next: 3.3 Benefits Up: 3 Reinventing X11 Previous: 3.1 Protocol OptionalTransport

3.2 Private X Resources

All X resources (windows, colormaps, cursors, graphics contexts, etc.) exist in a global name space. This is natural when the entire window system exists within X server. A second D11 performance advantage accrues from supporting ``private'' graphics contexts and pixmaps.

Rendering to pixmaps within the X server is inefficient because X requests are being generated, transported, and executed to manipulate what are essentially arrays of pixels within the X server's address space. Efficiency of rendering to pixmaps would be greatly improved if the pixmap resided in the client's address space. But the major advantage of pixmaps is that they can be used efficiently to transfer pixels to and from windows and other pixmaps via CopyArea requests.

D11 supports a private pixmap resource created by XCreatePrivatePixmap that is accessible only to the local D11 program that created it. The memory for the pixmap resides in the D11 program's address space, not within the D11 active context. Private pixmap rendering can be done without ever entering the D11 active context, greatly increasing the efficiency of pixmap rendering. The ease and efficiency of transferring pixels to and from other windows and pixmaps still exists because a D11 CopyArea request executing within the D11 active context can access the pixmap memory residing in the protected procedure caller's memory space. Use of private pixmaps by local D11 programs achieves both maximum rendering and CopyArea performance.

To support private pixmaps, private graphics contexts (GCs) are created by calling XCreatePrivateGC. Using public GCs with private pixmaps can work by reading the public GC state from the active context and using the public GC state as necessary.gif

Remote D11 programs can always fall back to conventional ``public'' pixmaps and GCs with lower pixmap rendering performance, so support of private pixmaps and GCs does not compromise network extensibility.

Since most X11 clients would work fine if all their GCs and pixmaps are treated as private resources, a mode set by the D11 routine XPrivateResourceMode forces the standard XCreatePixmap and XCreateGC routines to create private resources. With a single new routine an X program recompiled for D11 could benefit from private resources.



next up previous
Next: 3.3 Benefits Up: 3 Reinventing X11 Previous: 3.1 Protocol OptionalTransport



Mark Kilgard
Sun Jan 7 19:06:56 PST 1996